<!DOCTYPE html>
<html lang="zh">
<script>
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?bc04990a72f1dd0b20287368c447790d";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>分组列表 -Family族谱系统</title>
    <link rel="icon" href="favicon.ico" type="image/ico">
    <meta name="keywords" content="Family族谱系统">
    <meta name="description" content="Family族谱系统">
    <meta name="author" content="zeal">
    <link href="https://pan.zealsay.com/family/static/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet"
          href="https://cdn.jsdelivr.net/npm/bootstrap-select\@1.13.9/dist/css/bootstrap-select.min.css">
    <link href="https://pan.zealsay.com/family/static/css/materialdesignicons.min.css" rel="stylesheet">
    <!--对话框-->
    <link rel="stylesheet" href="/js/jconfirm/jquery-confirm.min.css">
    <link href="https://pan.zealsay.com/family/static/css/style.min.css" rel="stylesheet">
</head>

<body class="lyear-layout-sidebar-close">
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">

            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <a href="index.html">
                    <h4 class="h4 text-primary">Family族谱管理系统</h4>
                </a>
            </div>
            <div class="lyear-layout-sidebar-scroll">

                <nav class="sidebar-main">
                    <ul class="nav nav-drawer">
                        <li class="nav-item active"><a href="/index.html"><i class="mdi mdi-home"></i> 族谱树</a></li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-account"></i> 成员管理</a>
                            <ul class="nav nav-subnav">
                                <li><a href="/list.html">成员列表</a></li>
                                <li><a href="/add.html">成员添加</a></li>
                            </ul>
                        </li>
                        <li class="nav-item nav-item-has-subnav">
                            <a href="javascript:void(0)"><i class="mdi mdi-account-multiple"></i> 分组管理</a>
                            <ul class="nav nav-subnav">
                                <li><a href="/group_add.html">群组添加</a></li>
                                <li><a href="/group_list.html">群组列表</a></li>
                            </ul>
                        </li>
                    </ul>
                </nav>
            </div>

        </aside>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">

            <nav class="navbar navbar-default">
                <div class="topbar">

                    <div class="topbar-left">
                        <div class="lyear-aside-toggler">
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                        </div>
                        <span class="navbar-page-title"> 后台首页 </span>
                    </div>

                    <ul class="topbar-right">
                        <li class="dropdown dropdown-profile">
                            <a href="javascript:void(0)" data-toggle="dropdown">
                                <span>${session.SPRING_SECURITY_CONTEXT.authentication.principal.username!}  <span
                                        class="caret"></span></span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li><a href="/logout"><i class="mdi mdi-logout-variant"></i> 退出登录</a>
                                </li>
                            </ul>
                        </li>
                    </ul>

                </div>
            </nav>

        </header>
        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">

            <div class="container-fluid">

                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-toolbar clearfix">
                                <div class="toolbar-btn-action">
                                    <a class="btn btn-primary m-r-5" href="/group_add.html"><i class="mdi mdi-plus"></i>
                                        新增</a>
                                </div>
                            </div>
                            <div class="card-body">

                                <div class="table-responsive">
                                    <table class="table table-bordered">
                                        <thead>
                                        <tr>
                                            <th class="text-center" style='width:10%;'>编号</th>
                                            <th class="text-center" style='width:20%;'>名称</th>
                                            <th class="text-center" style='width:50%;'>备注</th>
                                            <th class="text-center" style='width:10%;'>录入日期</th>
                                            <th class="text-center" style='width:10%;'>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @ for(group in page.data){
                                        <tr>
                                            <td class="text-center">${groupLP.index}</td>
                                            <td class="text-center">${group.name}</td>
                                            <td class="text-center">${group.introduction}</td>
                                            <td class="text-center">${group.createDate}</td>
                                            <td class="text-center">
                                                <div class="btn-group">
                                                    <a class="btn btn-xs btn-default"
                                                       href="/group_edit.html?id=${group.id}" title="编辑"
                                                       data-toggle="tooltip"><i
                                                            class="mdi mdi-pencil"></i></a>
                                                    <a class="btn btn-xs btn-default" onclick="remove('${group.id}')"
                                                       title="删除"
                                                       data-toggle="tooltip"><i
                                                            class="mdi mdi-window-close"></i></a>
                                                </div>
                                            </td>
                                        </tr>
                                        @ }


                                        </tbody>
                                    </table>
                                </div>
                                <ul class="pagination pagination-circle">
                                    <li>
                                        <a href="/list.html?pageNumber=${page.pageNumber-1>0?page.pageNumber-1:1}&pageSize=${page.pageSize}">
                                            <span><i class="mdi mdi-chevron-left"></i></span>
                                        </a>
                                    </li>
                                    @ if(page.total>8){
                                    <li><a
                                            href="/list.html?pageNumber=${page.pageNumber-2}&pageSize=${page.pageSize}">${page.pageNumber-2}</a>
                                    </li>
                                    <li><a
                                            href="/list.html?pageNumber=${page.pageNumber-1}&pageSize=${page.pageSize}">${page.pageNumber-1}</a>
                                    </li>
                                    <li class="active"><a
                                            href="/list.html?pageNumber=${page.pageNumber}&pageSize=${page.pageSize}">${page.pageNumber}</a>
                                    </li>
                                    <li><a
                                            href="/list.html?pageNumber=${page.pageNumber+1}&pageSize=${page.pageSize}">${page.pageNumber+1}</a>
                                    </li>
                                    <li><a
                                            href="/list.html?pageNumber=${page.pageNumber+2}&pageSize=${page.pageSize}">${page.pageNumber+2}</a>
                                    </li>
                                    @ } else{
                                    @ for(var i=1;i<=page.total;i++){
                                    <li class="${i == page.pageNumber?'active'}"><a
                                            href="/list.html?pageNumber=${i}&pageSize=${page.pageSize}">${i}</a>
                                    </li>
                                    @ }}
                                    <li>
                                        <a href="/list.html?pageNumber=${page.pageNumber+1<=page.total?page.pageNumber+1:1}&pageSize=${page.pageSize}">
                                            <span><i class="mdi mdi-chevron-right"></i></span>
                                        </a>
                                    </li>
                                </ul>

                            </div>
                        </div>
                    </div>
                </div>

            </div>

        </main>
        <!--End 页面主要内容-->
    </div>
</div>

<script type="text/javascript" src="https://pan.zealsay.com/family/static/js/jquery.min.js"></script>
<script type="text/javascript" src="https://pan.zealsay.com/family/static/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select\@1.13.9/dist/js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="https://pan.zealsay.com/family/static/js/perfect-scrollbar.min.js"></script>
<!--对话框-->
<script src="https://pan.zealsay.com/family/static/js/jconfirm/jquery-confirm.min.js"></script>
<script type="text/javascript" src="https://pan.zealsay.com/family/static/js/main.min.js"></script>

<script type="text/javascript">
    function remove(id) {
        $.confirm({
            title: '操作提示',
            content: '确定要删除吗？',
            buttons: {
                confirm: {
                    text: '确定',
                    action: function () {
                        $.get("group/delete/" + id, function (data) {
                            window.location.reload()
                        });
                    }
                },
                cancel: {
                    text: '取消',
                    action: function () {

                    }
                }
            }
        })
    }

</script>
</body>

</html>